module button(
			input	fast_clock,
			input [0:0] key,
			output reg led2);


reg [32:0] temp_time = 0;
reg [4:0] state = 0;

always@(posedge fast_clock)
begin
	if(key == 0) // 按下按键
		state <= 1;
	case(state)
	0: 
		begin
		led2 <= 0;
		temp_time <= 0;
		end
	1: 
		begin
			if(temp_time < 10000000)
				temp_time <= temp_time + 1;
			else
				state <= 2;
		end
	2: 
		begin
			temp_time <= 0;
			led2 <= 1;
			state <= 0;
		end
	endcase
end

endmodule 